package com.example.teacher.Converter;

import com.example.common.constants.OtherConstants;
import com.example.common.domain.dto.WorkDto;
import com.example.common.domain.pojo.Homework;
import com.example.common.utils.UUIDUtil;

public class HomeWorkConverter {

    public static Homework WorkDtoTO(WorkDto work) {
        Homework homework = new Homework();
        homework.setId(UUIDUtil.generate(OtherConstants.HOMEWORK_ID));   // 1
        homework.setCourseId(work.getCourseId());
        homework.setClassId(work.getClassId());
        homework.setTeacherId(work.getTeacherId());
        homework.setHomeworkName(work.getHomeworkName());
        homework.setStartTime(work.getStartTime());
        homework.setUpdateTime(work.getUpdateTime());      // 7
        homework.setStatus(0);
        return homework;
    }
}
